<template>
  <div :class="clz">
    <span >{{text1}}</span>
    <span >{{text2}}</span>
  </div>
</template>

<script>
  export default {
    name:'ColumnDate',
    props:{
      scope:Object,
      column:{
        type:Object
      }
    },
    data(){
      return {
        clz:'datetxt',
        text1:'',
        text2:''
      }
    },
    created(){
      this.getValue(this.scope.row);
    },
    methods:{
      getValue(row){
        let format = this.column.format || "YYYY-MM-DD"
        let val = row[this.column.prop];
        if(val){
          let textArr = _.MOMENT(val).format(format).split(' ');
          this.text1 = textArr[0];
          this.text2 = textArr[1] || '';
        }
      }
    }
  }
</script>
<style lang="scss">
  .datetxt{
    span{
      display: block;
    }
  }
</style>
